using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using Se.Framework.Common.Data;
using Trust.Casas.Model.Support;

namespace Trust.Casas.Model.Entities
{
    [Table("User")]
    [DataContract]
    public class User : AuditableEntity, IGenericEntity
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        [DataMember]
        public int Id { get; set; }

        [DataMember]
        [StringLength(150)]
        [Index]
        public string Name { get; set; }
        
        public object GenericId
        {
            get
            {
                return Id;
            }
        }

        public override string ToString()
        {
            return Name;
        }
    }
}